/*  1:   */ package org.intellij.plugins.relaxNG.model.descriptors;
/*  2:   */ 
/*  3:   */

import com.intellij.util.SpinAllocator;
import com.intellij.util.SpinAllocator.ICreator;
import com.intellij.util.SpinAllocator.IDisposer;
import com.intellij.util.containers.ContainerUtil;
import gnu.trove.THashSet;
import org.kohsuke.rngom.digested.*;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */
/* 10:   */
/* 11:   */
/* 12:   */
/* 13:   */ 
/* 14:   */ public class RecursionSaveWalker
/* 15:   */   extends DPatternWalker
/* 16:   */ {
/* 17:   */   private THashSet<DPattern> a;
/* 18:   */   
/* 19:   */   public Void onGrammar(DGrammarPattern paramDGrammarPattern)
/* 20:   */   {
/* 21:38 */     if (this.a.add(paramDGrammarPattern)) {
/* 22:   */       try
/* 23:   */       {
/* 24:40 */         return super.onGrammar(paramDGrammarPattern);
/* 25:   */       }
/* 26:   */       catch (NullPointerException localNullPointerException)
/* 27:   */       {
/* 28:42 */         return null;
/* 29:   */       }
/* 30:   */     }
/* 31:45 */     return null;
/* 32:   */   }
/* 33:   */   
/* 34:   */   public Void onRef(DRefPattern paramDRefPattern)
/* 35:   */   {
/* 36:49 */     if (this.a.add(paramDRefPattern)) {
/* 37:   */       try
/* 38:   */       {
/* 39:51 */         return super.onRef(paramDRefPattern);
/* 40:   */       }
/* 41:   */       catch (NullPointerException localNullPointerException)
/* 42:   */       {
/* 43:53 */         return null;
/* 44:   */       }
/* 45:   */     }
/* 46:56 */     return null;
/* 47:   */   }
/* 48:   */   
/* 49:   */   protected Void onUnary(DUnaryPattern paramDUnaryPattern)
/* 50:   */   {
/* 51:60 */     if (this.a.add(paramDUnaryPattern)) {
/* 52:   */       try
/* 53:   */       {
/* 54:62 */         return super.onUnary(paramDUnaryPattern);
/* 55:   */       }
/* 56:   */       catch (NullPointerException localNullPointerException)
/* 57:   */       {
/* 58:64 */         return null;
/* 59:   */       }
/* 60:   */     }
/* 61:67 */     return null;
/* 62:   */   }
/* 63:   */   
/* 64:   */   protected void doAccept(DPattern... paramVarArgs)
/* 65:   */   {
/* 66:71 */     this.a = ((THashSet)b.alloc());
/* 67:   */     try
/* 68:   */     {
/* 69:74 */       for (int i = 0; i < paramVarArgs.length; i++) {
/* 70:75 */         paramVarArgs[i].accept(this);
/* 71:   */       }
/* 72:   */     }
/* 73:   */     finally
/* 74:   */     {
/* 75:78 */       b.dispose(this.a);
/* 76:   */     }
/* 77:   */   }
/* 78:   */   
/* 79:82 */   private static final SpinAllocator<THashSet<DPattern>> b = new SpinAllocator(new SpinAllocator.ICreator()new SpinAllocator.IDisposer
/* 80:   */   {
/* 81:   */     public THashSet<DPattern> createInstance()
/* 82:   */     {
/* 83:86 */       return ContainerUtil.newIdentityTroveSet(256);
/* 84:   */     }
/* 85:82 */   }, new SpinAllocator.IDisposer()
/* 86:   */   {
/* 87:   */     public void disposeInstance(THashSet<DPattern> paramAnonymousTHashSet)
/* 88:   */     {
/* 89:91 */       paramAnonymousTHashSet.clear();
/* 90:   */     }
/* 91:82 */   });
/* 92:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.intellij.plugins.relaxNG.model.descriptors.RecursionSaveWalker

 * JD-Core Version:    0.7.0.1

 */